package com.qianfeng.es.service;
//
//                            _ooOoo_  
//                           o8888888o  
//                           88" . "88  
//                           (| -_- |)  
//                            O\ = /O  
//                        ____/`---'\____  
//                      .   ' \\| |// `.  
//                       / \\||| : |||// \  
//                     / _||||| -:- |||||- \  
//                       | | \\\ - /// | |  
//                     | \_| ''\---/'' | |  
//                      \ .-\__ `-` ___/-. /  
//                   ___`. .' /--.--\ `. . __  
//                ."" '< `.___\_<|>_/___.' >'"".  
//               | | : `- \`.;`\ _ /`;.`/ - ` : | |  
//                 \ \ `-. \_ __\ /__ _/ .-` / /  
//         ======`-.____`-.___\_____/___.-`____.-'======  
//                            `=---='  
//  
//         .............................................  
//                  佛祖镇楼                  BUG辟易  
//          佛曰:  
//                  写字楼里写字间，写字间里程序员；  
//                  程序人员写程序，又拿程序换酒钱。  
//                  酒醒只在网上坐，酒醉还来网下眠；  
//                  酒醉酒醒日复日，网上网下年复年。  
//                  但愿老死电脑间，不愿鞠躬老板前；  
//                  奔驰宝马贵者趣，公交自行程序员。  
//                  别人笑我忒疯癫，我笑自己命太贱；  
//  


import org.elasticsearch.index.query.Operator;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;

/**
 * Created by Jackiechan on 2022/1/17/16:00
 *
 * @author Jackiechan
 * @version 1.0
 * @since 1.0
 */
public interface QueryService {
    void termQuery(String index, String filed, String value) throws Exception;
    void termsQuery(String index, String filed, String ... value) throws  Exception;
    void matchAll(String index) throws  Exception;
    void match(String index, String field, String value) throws Exception;
    void boolMatch(String index, String field, String value, Operator operator) throws Exception;
    void multiMacth(String index, String value, String... fields) throws Exception;
    void idQuery(String index, String id) throws Exception;
    void idsQuery(String index, String... ids) throws Exception;
    void prefixQuery(String index, String field, String prefix) throws Exception;
    void fuzzyQuery(String index, String field, String value,int prefix_length) throws Exception;
    void wildcardQuery(String index, String field, String value) throws Exception;
    void rangeQuery(String index ,String field,long gte,long lte)throws Exception;

    void regQuery(String index, String field, String reg) throws Exception;

    String createScrollQuery(String index, QueryBuilder queryBuilder, int size)throws Exception;

    void srollQuery( String scrollId)throws Exception;

    void clearScroll(String index, String scrollId)throws Exception;

    void deleteByQuery(String index, QueryBuilder queryBuilder)throws Exception;

    void boostQuery(String index, QueryBuilder queryBuilder, QueryBuilder boostBuilder, float boost) throws Exception;

    void highLight(String index, QueryBuilder queryBuilder, HighlightBuilder highlightBuilder) throws Exception;

    void cardinalityAgg(String index, String field)throws Exception;
    void rangeAgg(String index, AggregationBuilder aggregationBuilder)throws Exception;
    void dateRangeAgg(String index, AggregationBuilder aggregationBuilder)throws Exception;
    void ipRangeAgg(String index, AggregationBuilder aggregationBuilder)throws Exception;
    void extendedStats(String index, String field)throws Exception;

}
